package tcards.android;

public class Point2D {
	private float x;
	private float y;
	
	
	public Point2D(float x, float y) {
		this.x = x;
		this.y = y;
	}
	
	public float x() { return x; }
	public float y() { return y; }	
	
	public float length(Point2D endPoint) {
		return (float)Math.sqrt(Math.pow(x - endPoint.x, 2.0) + Math.pow(y - endPoint.y, 2.0));
	}
	
	public Point2D add(Point2D other) {
		return new Point2D(x + other.x, y + other.y());
	}
}
